1. Field of the Invention
The present invention relates to an image device with image defocus function and a method generating a defocus image thereof, and particularly to an operation load and time consumption of the image device are significantly reduced when the image device and the method execute a defocus operation.
2. Description of the Prior Art
When an image device executes a bokeh processing on an image captured by the image device, the image device will execute a defocus operation on other objects of the image except a predetermined object of the image. That is to say, after the image device executes the bokeh processing on the image, the greater a distance between an object of the other objects and the predetermined object is, the blurrier a corresponding image of the object included in the image is. Please refer to FIG. 1. FIG. 1 is a diagram illustrating a size of a filter window 102 when the image device utilizes an average filtering method to execute the defocus operation in a pixel image 100 of the image, wherein the image device further generates a depth map corresponding to the image according to the image, and the pixel image 100 corresponds to a pixel of the image device. As shown in FIG. 1, when the image device executes the defocus operation on the pixel image 100, the image device first sums color pixel values of a plurality of pixel images included in the filter window 102 (e.g. as shown in FIG. 1, the image device sums color pixel values of 68 pixel images included in the filter window 102) to generate a total color pixel value corresponding to the pixel image 100, wherein a number of the plurality of pixel images is significantly increased with increase of a difference between a depth of the depth map corresponding to the pixel image 100 and a depth of the depth map corresponding to the predetermined object. After the total color pixel value corresponding to the pixel image 100 is generated, the image device averages the total color pixel value corresponding to the pixel image 100 to generate a defocus color pixel value corresponding to the pixel image 100. As shown in FIG. 1, because the image device needs to sum the color pixel values of the plurality of pixel images included in the filter window 102 to generate the total color pixel value corresponding to the pixel image 100, times of an adding operation executed by the image device will also be significantly increased with increase of the difference. Because the times of the adding operation executed by the image device will be significantly increased with increase of the difference, an operation load and time consumption of the image device will also be significantly increased. Therefore, how to reduce the operation load and the time consumption of the image device during the image device executing the defocus operation becomes an important issue for a designer of the image device.